home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
PROGRAMM
/
PASCAL
/
0798.ZIP
/
SAMPLE.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1987-10-05
|
13KB
|
426 lines
(*ScreenEngine
ScrnSample
1 2 15 35
18 11 0 0 21 15 0 5 1 LastName
zzzzzzzzzzzzzzzzzzzz
1 6 80 23 2 2 15 1 0
18 13 0 0 21 15 0 5 1 FirstName
zzzzzzzzzzzzzzzzzzzz
20 15 0 0 1 15 0 5 1 MiddleInit
Z
11 17 0 0 28 15 0 5 1 Street
zzzzzzzzzzzzzzzzzzzzzzzzzz
18 19 0 0 21 15 0 5 1 Town
zzzzzzzzzzzzzzzzz
13 21 0 0 2 15 0 5 1 State
AL
WY
29 21 0 0 5 15 0 5 1 Zip
00000
99999
51 11 0 0 25 15 0 5 1 DrName
zzzzzzzzzzzzzzzzzzzzzzzz
68 13 4 0 8 15 0 6 1 LastVisit
000101
991231
68 15 0 0 3 15 0 3 1 TreatCode
0 333
68 17 1 2 6 15 0 4 1 Charges
2.5000000000E+01 3.0000000000E+02
3 11 0 0 10 1 15 2 0 Last Name:
42 13 0 0 25 1 15 2 0 Date of Visit (MM/DD/YY):
43 21 0 0 16 4 14 2 0 Account Balance:
68 21 1 2 8 15 0 4 0 Balance
0.0000000000E+00 0.0000000000E+00
24 21 0 0 4 1 15 2 0 ZIP:
3 17 0 0 7 1 15 2 0 Street:
19 3 0 0 36 4 15 2 0 CLIENT INFORMATION MANAGEMENT SYSTEM
3 13 0 0 11 1 15 2 0 First Name:
3 15 0 0 15 1 15 2 0 Middle Initial:
40 7 40 22 2 2 15 1 2
40 23 40 23 202 2 15 1 2
40 6 40 6 203 2 15 1 2
2 7 39 9 1 2 15 1 2
15 8 0 0 11 1 15 2 0 CLIENT DATA
41 7 79 9 1 2 15 1 2
52 8 0 0 16 1 15 2 0 APPOINTMENT DATA
42 11 0 0 7 1 15 2 0 Doctor:
3 19 0 0 13 1 15 2 0 City or Town:
42 15 0 0 25 1 15 2 0 Treatment Code (000-333):
3 21 0 0 6 1 15 2 0 State:
42 17 0 0 23 1 15 2 0 Charges (25.00-300.00):
1 1 80 5 3 3 12 1 0
42 20 77 22 1 2 15 1 2
*)
Program ScrnSample; {Replace this line with your own}
{Type declaration}
type
TSStr = String[80];
TSCharSet = set of char;
TSDate = String[6];
{Global variables}
var
TSString : TSStr;
TSDefAttrib: byte; {Screen color attribute}
TSInsMode : boolean; {keeps track of the insert key}
LastName: String[21];
FirstName: String[21];
MiddleInit: String[1];
Street: String[28];
Town: String[21];
State: String[2];
Zip: String[5];
DrName: String[25];
LastVisit: TSDate;
TreatCode: integer;
Charges: real;
Balance: real;
{$I TBS.UTL}
{$I TBSREAL.UTL} {utilities for real variables. Delete if not needed}
{$I TBSDATE.UTL} {utilities for date variables. Delete if not needed}
{$I TBSINT.UTL} {utilities for integer variables. Delete if not needed}
procedure PutTitleScrnSample;
begin
TextBackground(2);
TextColor(15);
ClrScr;
Box(1,6,80,23,2,47,
'O.O=!O>ΘO-Ω).N0 P.v0 Q;t= ');
Box(1,1,80,5,3,60,
'');
PutVariableOrLabel(3,11,31,'Last Name:',10);
PutVariableOrLabel(42,13,31,'Date of Visit (MM/DD/YY):',25);
PutVariableOrLabel(43,21,78,'Account Balance:',16);
PutVariableOrLabel(24,21,31,'ZIP:',4);
PutVariableOrLabel(3,17,31,'Street:',7);
PutVariableOrLabel(19,3,79,'CLIENT INFORMATION MANAGEMENT SYSTEM',36);
PutVariableOrLabel(3,13,31,'First Name:',11);
PutVariableOrLabel(3,15,31,'Middle Initial:',15);
PutVariableOrLabel(15,8,31,'CLIENT DATA',11);
PutVariableOrLabel(52,8,31,'APPOINTMENT DATA',16);
PutVariableOrLabel(42,11,31,'Doctor:',7);
PutVariableOrLabel(3,19,31,'City or Town:',13);
PutVariableOrLabel(42,15,31,'Treatment Code (000-333):',25);
PutVariableOrLabel(3,21,31,'State:',6);
PutVariableOrLabel(42,17,31,'Charges (25.00-300.00):',23);
end; {of procedure}
procedure OutVarScrnSample(
var LastName : TSStr;
var FirstName : TSStr;
var MiddleInit : TSStr;
var Street : TSStr;
var Town : TSStr;
var State : TSStr;
var Zip : TSStr;
var DrName : TSStr;
var LastVisit : TSDate;
var TreatCode : Integer;
var Charges : Real;
var Balance : Real);
begin
PutVariableOrLabel(18,11,240,LastName,
21);
PutVariableOrLabel(18,13,240,FirstName,
21);
PutVariableOrLabel(20,15,240,MiddleInit,
1);
PutVariableOrLabel(11,17,240,Street,
28);
PutVariableOrLabel(18,19,240,Town,
21);
PutVariableOrLabel(13,21,240,State,
2);
PutVariableOrLabel(29,21,240,Zip,
5);
PutVariableOrLabel(51,11,240,DrName,
25);
PutDate(68,13,240,LastVisit,
'/',3,1,2);
PutInteger(68,15,240,TreatCode,
3);
PutReal(68,17,240,Charges,
6,1,2);
PutReal(68,21,240,Balance,
8,1,2);
end;
procedure InpVarScrnSample(
var LastName : TSStr;
var FirstName : TSStr;
var MiddleInit : TSStr;
var Street : TSStr;
var Town : TSStr;
var State : TSStr;
var Zip : TSStr;
var DrName : TSStr;
var LastVisit : TSDate;
var TreatCode : Integer;
var Charges : Real;
var Balance : Real);
{$V-} {Do not remove this compiler directive
it is required to disable type checking in this procedure}
type
TSCharSet = set of Char;
var
Chr1,Chr2 : Char;
L : Byte;
Const
End1 : TSCharSet = [^I,^M,#27,#10];
End2 : TSCharSet = ['H','P',#15];
begin
OutVarScrnSample(
LastName,
FirstName,
MiddleInit,
Street,
Town,
State,
Zip,
DrName,
LastVisit,
TreatCode,
Charges,
Balance);
L := 1;
repeat
case L of
1 : GetString(18,11,240,LastName,End1,End2,Chr1,Chr2,
21,'','zzzzzzzzzzzzzzzzzzzz');
2 : GetString(18,13,240,FirstName,End1,End2,Chr1,Chr2,
21,'','zzzzzzzzzzzzzzzzzzzz');
3 : GetString(20,15,240,MiddleInit,End1,End2,Chr1,Chr2,
1,'','Z');
4 : GetString(11,17,240,Street,End1,End2,Chr1,Chr2,
28,'','zzzzzzzzzzzzzzzzzzzzzzzzzz');
5 : GetString(18,19,240,Town,End1,End2,Chr1,Chr2,
21,'','zzzzzzzzzzzzzzzzz');
6 : GetString(13,21,240,State,End1,End2,Chr1,Chr2,
2,'AL','WY');
7 : GetString(29,21,240,Zip,End1,End2,Chr1,Chr2,
5,'00000','99999');
8 : GetString(51,11,240,DrName,End1,End2,Chr1,Chr2,
25,'','zzzzzzzzzzzzzzzzzzzzzzzz');
9 : GetDate(68,13,240,LastVisit,End1,End2,Chr1,Chr2,
'/',3,1,2,'000101','991231');
10 : GetInteger(68,15,240,TreatCode,End1,End2,Chr1,Chr2,
3,0,333);
11 : GetReal(68,17,240,Charges,End1,End2,Chr1,Chr2,
6,1,2, 2.5000000000E+01, 3.0000000000E+02);
end; {of case}
if (Chr1 = ^I) or (Chr1 = ^M) or ((Chr1 = #27) and (Chr2 ='P')) then
if L = 11 then L := 1 else L := L+1
else
if (Chr1 = #27) and ((Chr2 = 'H') or (Chr2 = #15)) then
if L = 1 then L := 11 else L := L-1;
until ((Chr1 = ^M) and (L = 1)) or (Chr1 = #10);
{$V+} {Do not remove this compiler directive
it enables type checking}
end;
procedure InpScrnSample(
var LastName : TSStr;
var FirstName : TSStr;
var MiddleInit : TSStr;
var Street : TSStr;
var Town : TSStr;
var State : TSStr;
var Zip : TSStr;
var DrName : TSStr;
var LastVisit : TSDate;
var TreatCode : Integer;
var Charges : Real;
var Balance : Real);
begin
(************** Initialize Variables **************)
(* SUBSTITUTE THESE VALUES WITH YOUR OWN DEFAULTS *)
LastName := '';
FirstName := '';
MiddleInit := '';
Street := '';
Town := '';
State := '';
Zip := '';
DrName := '';
LastVisit := '000101';
TreatCode := 0;
Charges := 0.0;
Balance := 0.0;
PutTitleScrnSample;
InpVarScrnSample(
LastName,
FirstName,
MiddleInit,
Street,
Town,
State,
Zip,
DrName,
LastVisit,
TreatCode,
Charges,
Balance);
end; {of procedure}
procedure EditScrnSample(
var LastName : TSStr;
var FirstName : TSStr;
var MiddleInit : TSStr;
var Street : TSStr;
var Town : TSStr;
var State : TSStr;
var Zip : TSStr;
var DrName : TSStr;
var LastVisit : TSDate;
var TreatCode : Integer;
var Charges : Real;
var Balance : Real);
begin
PutTitleScrnSample;
InpVarScrnSample(
LastName,
FirstName,
MiddleInit,
Street,
Town,
State,
Zip,
DrName,
LastVisit,
TreatCode,
Charges,
Balance);
end; {of procedure}
procedure OutScrnSample(
var LastName : TSStr;
var FirstName : TSStr;
var MiddleInit : TSStr;
var Street : TSStr;
var Town : TSStr;
var State : TSStr;
var Zip : TSStr;
var DrName : TSStr;
var LastVisit : TSDate;
var TreatCode : Integer;
var Charges : Real;
var Balance : Real);
begin
PutTitleScrnSample;
OutVarScrnSample(
LastName,
FirstName,
MiddleInit,
Street,
Town,
State,
Zip,
DrName,
LastVisit,
TreatCode,
Charges,
Balance);
end; {of procedure}
(**************Test Program************)
(***SUBSTITUTE THIS PROGRAM WITH YOUR OWN***)
begin
TSInsMode := false;
TSDefAttrib := 47;
(* Place the following calling sequence in the appropriate
location in your program *)
{$V-} {Do not remove this compiler directive
it is required to disable type checking in this procedure}
InpScrnSample(
LastName,
FirstName,
MiddleInit,
Street,
Town,
State,
Zip,
DrName,
LastVisit,
TreatCode,
Charges,
Balance);
{$V+} {Do not remove this compiler directive
it enables type checking}
{delete the next three lines after you have tested the screen program}
GotoXY(1,25);ClrEOL;
write('End of Input test. Press any key to continue');
repeat until KeyPressed;
(* Place the following calling sequence in the appropriate
location in your program *)
{$V-} {Do not remove this compiler directive
it is required to disable type checking in this procedure}
OutScrnSample(
LastName,
FirstName,
MiddleInit,
Street,
Town,
State,
Zip,
DrName,
LastVisit,
TreatCode,
Charges,
Balance);
{$V+} {Do not remove this compiler directive
it enables type checking}
{delete the next three lines after you have tested the screen program}
GotoXY(1,25);ClrEOL;
write('End of Output test. Press any key to continue');
repeat until KeyPressed;
(* Place the following calling sequence in the appropriate
location in your program *)
{$V-} {Do not remove this compiler directive
it is required to disable type checking in this procedure}
EditScrnSample(
LastName,
FirstName,
MiddleInit,
Street,
Town,
State,
Zip,
DrName,
LastVisit,
TreatCode,
Charges,
Balance);
{$V+} {Do not remove this compiler directive
it enables type checking}
{delete the next three lines after you have tested the screen program}
GotoXY(1,25);ClrEOL;
write('End of program test. Press any key to continue');
repeat until KeyPressed;
{delete next line after you have tested the screen program}
end.